﻿using UnityEngine;
using System.Collections.Generic;
using COC.Tools.Pathing.AIViewModel;
using COC.Tools.Pathing.Misc;
using System.Collections;

namespace COC.Tools.Pathing
{
    public class CPath
    {
        public int[,] whichList;
        public GraphNode[,] node;
        public CBinaryHeap cBinaryHeap;
        public GraphNodeHandler GraphNodeHandler;
        public int id; //reference that opposed to ai Stack.
        public PathInfo mPathInfo;
        public PathInfo.PathState STATE = PathInfo.PathState.NONE;
		public Vector3 startingXY;
		public Vector3 targetXY;
		public string message;
        public CPath()
        {
        }

       
        public void construction(int x,int y)
        {
            whichList=new int[x,y];
            node = new GraphNode[x, y];
            return;
        }

        public void reset()
        {
           
        }
        private void clearAll()
        {
           clearBinaryHeap();
           clearWhichList();
        }
        private void clearBinaryHeap()
        {
          
        }
        private void clearWhichList()
        {
            if (whichList != null && whichList.Length > 0)
            {
                for (int i = 0; i < whichList.GetLength(0);i++ )
                {
                    for (int j = 0; j < whichList.GetLength(1); j++)
                    {
                        whichList[i, j] = GraphNode.State.NONE;
                    }
                }
            }
        }
        private void clearPPathNode()
        {
            if (node != null && node.Length > 0)
            {
                for (int i = 0; i < node.GetLength(0); i++)
                {
                    for (int j = 0; j < node.GetLength(1); j++)
                    {
                        node[i, j] = null;
                    }
                }
            }
        }

    }
}
